package com.tanhua.model.vo;

import com.tanhua.model.db.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.IdentityHashMap;

/**
 * 用户信息表
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfoVoContacts implements Serializable {

    private Long id;
    private String userId;
    private String nickname; //昵称
    private String avatar; //用户头像
    private String gender; //性别
    private Integer age; //年龄
    private String city;

    public static UserInfoVoContacts init(UserInfo userInfo){
        UserInfoVoContacts user = new UserInfoVoContacts();
        user.setUserId(userInfo.getId().toString());
        user.setNickname(userInfo.getNickname());
        user.setAvatar(userInfo.getAvatar());
        user.setCity(userInfo.getCity());
        user.setGender(userInfo.getGender());
        user.setAge(userInfo.getAge());
        return user;
    }
}